import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.net.InetAddress;


public class File {
	
	public static void main(String argv[]) throws IOException {
		
		
		String stringa = new String("");
		FileWriter fwr = null;
		fwr = new FileWriter("file.txt");
		InetAddress ip =InetAddress.getByName("dcdt.ing.unibs.it");
				System.out.println(ip);
				
		for(int i = 0; i <= 101; i++) {
			stringa = "Questa "+i;
			fwr.write(stringa);
		}
		fwr.flush();
		fwr.close();
		
		
		fwr = new FileWriter("file1.txt");
		FileReader frd = new FileReader("file.txt");
		
		int i;
		while((i = frd.read()) != -1) { //legge carattere x carattere
			System.out.println(i);
			fwr.write(i);
		}
		
		fwr.flush();
		fwr.close();
		
		frd.close();

	}
}
